package com.dragon.modules.yuegou.query.points;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.points.SignDetailEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;
/**
 * 签到明细表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-04-24 17:38:26
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class SignDetailQuery extends SignDetailEntity implements Query<SignDetailEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 商圈id查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 会员id查询条件 */
	@JsonUnwrapped(prefix = "memberId")
	private Condition<String> memberIdCondition;

    /** 签到获取积分查询条件 */
	@JsonUnwrapped(prefix = "points")
	private Condition<Integer> pointsCondition;

    /** 获取时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 已连续天数查询条件 */
	@JsonUnwrapped(prefix = "continuousDay")
	private Condition<Integer> continuousDayCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public SignDetailQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public SignDetailQuery(SignDetailEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public SignDetailQuery(SignDetailQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if(other.memberIdCondition != null) {
			this.memberIdCondition = other.memberIdCondition.copy();
		}
		if(other.pointsCondition != null) {
			this.pointsCondition = other.pointsCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.continuousDayCondition != null) {
			this.continuousDayCondition = other.continuousDayCondition.copy();
		}
	}

	@Override
	public QueryWrapper<SignDetailEntity> toQueryWrapper() {
		QueryWrapper<SignDetailEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (memberIdCondition != null) {
			memberIdCondition.toWrapper(wrapper, COL_MEMBER_ID);
		}
		if (pointsCondition != null) {
			pointsCondition.toWrapper(wrapper, COL_POINTS);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (continuousDayCondition != null) {
			continuousDayCondition.toWrapper(wrapper, COL_CONTINUOUS_DAY);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回商圈id查询条件
	 * 
	 * @return busdIdCondition 商圈id查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取商圈id查询条件
	 * 
	 * @return busdIdCondition 商圈id查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈id查询条件
	 * 
	 * @param busdIdCondition 商圈id查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回会员id查询条件
	 * 
	 * @return memberIdCondition 会员id查询条件
	 */
	public Condition<String> memberId() {
		this.memberIdCondition = new Condition<>();
		return this.memberIdCondition;
	}
	
	/**
	 * 获取会员id查询条件
	 * 
	 * @return memberIdCondition 会员id查询条件
	 */
	public Condition<String> getMemberIdCondition() {
		return memberIdCondition;
	}

	/**
	 * 设置会员id查询条件
	 * 
	 * @param memberIdCondition 会员id查询条件
	 */
	public void setMemberIdCondition(Condition<String> memberIdCondition) {
		this.memberIdCondition = memberIdCondition;
	}

	/**
	 * 构造并返回签到获取积分查询条件
	 * 
	 * @return pointsCondition 签到获取积分查询条件
	 */
	public Condition<Integer> points() {
		this.pointsCondition = new Condition<>();
		return this.pointsCondition;
	}
	
	/**
	 * 获取签到获取积分查询条件
	 * 
	 * @return pointsCondition 签到获取积分查询条件
	 */
	public Condition<Integer> getPointsCondition() {
		return pointsCondition;
	}

	/**
	 * 设置签到获取积分查询条件
	 * 
	 * @param pointsCondition 签到获取积分查询条件
	 */
	public void setPointsCondition(Condition<Integer> pointsCondition) {
		this.pointsCondition = pointsCondition;
	}

	/**
	 * 构造并返回获取时间查询条件
	 * 
	 * @return createdTimeCondition 获取时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取获取时间查询条件
	 * 
	 * @return createdTimeCondition 获取时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置获取时间查询条件
	 * 
	 * @param createdTimeCondition 获取时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回已连续天数查询条件
	 * 
	 * @return continuousDayCondition 已连续天数查询条件
	 */
	public Condition<Integer> continuousDay() {
		this.continuousDayCondition = new Condition<>();
		return this.continuousDayCondition;
	}
	
	/**
	 * 获取已连续天数查询条件
	 * 
	 * @return continuousDayCondition 已连续天数查询条件
	 */
	public Condition<Integer> getContinuousDayCondition() {
		return continuousDayCondition;
	}

	/**
	 * 设置已连续天数查询条件
	 * 
	 * @param continuousDayCondition 已连续天数查询条件
	 */
	public void setContinuousDayCondition(Condition<Integer> continuousDayCondition) {
		this.continuousDayCondition = continuousDayCondition;
	}

}
